﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Wlmy.Ids4.Repository
{
    public interface IBaseRepository<T>
    {
        Task AddAsync(T entity);
        Task AddRangeAsync(List<T> entities);
        void UpdateRange(List<T> entities);
        Task DeleteAsync(T entity);
        Task DeleteAsync(int id);
        void DeleteRange(List<T> entities);
        Task<T> SingleAsync(Expression<Func<T, bool>> expression);
        IQueryable<T> GetALL();
        IQueryable<T> Where(Expression<Func<T, bool>> expression);
        Task<bool> AnyAsync(Expression<Func<T, bool>> expression);
        Task<T> GetByIdAsync(int id);
        Task SaveChangesAsync();
        Task UpdateAsync(T entity);
        Task<T> GetByIdIncludeNavAsync(int id);
        Task<T> SingleIncludeNavAsync(Expression<Func<T, bool>> expression);
        void SaveChanges();
    }
}